<!--
 * @Date: 2022-12-25 14:59:55
 * @LastEditors: 于波
 * @LastEditTime: 2022-12-25 21:07:24
 * @Description: 
-->
<template>
    <div id="main">
        <ks-header />
        <router-view></router-view>
    </div>
</template>

<script setup>
import { ElMessageBox } from 'element-plus';
import 'element-plus/es/components/message-box/style/css';
import { useRoute } from 'vue-router';

import store from './store';
const route = useRoute();
window.onbeforeunload = function () {
    if (route.path.includes('write') && !store.state.saveStatus) {
        return true;
    }
};
if (store.state.dialog.isShow) {
    ElMessageBox.alert(store.state.dialog.content, '提示', {
        confirmButtonText: '确定',
        callback: () => {
            store.commit('setDialogInfo', {
                isShow: false,
                title: '',
                content: '',
            });
        },
    });
}
</script>

<style>
#app {
    height: 100%;
}
html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
}
#main {
    height: 100%;
}
/*  适配手机屏幕 */
@media screen and (max-width: 768px) {
    body {
        padding-bottom: 80px;
        box-sizing: border-box;
    }
}
/* 设置自定义滚动条样式 */
::-webkit-scrollbar {
    width: 10px;
    background-color: rgb(207, 207, 207);
}
::-webkit-scrollbar-thumb {
    background-color: #9e9e9e;
    background-clip: padding-box; /*背景被裁剪到内边距框   content-box 背景裁剪到内容框*/
    min-width: 5px;
    border-radius: 5px;
}
a {
    text-decoration: none;
    color: #000;
}
</style>
